package com.yao.seckill.web.utils;

import org.apache.commons.lang3.StringUtils;

import java.util.regex.Pattern;

/**
 * Copyright (C), 2022-2022, 姚兵
 * Author: 32210
 * Date: 2022/8/30 19:26
 * FileName: ValidateUtils
 * Description: 验证工具类
 */
public class ValidateUtils {
    public static final Pattern pattern=Pattern.compile("[1][3,5,7,8][0-9]\\\\d{8}$");

    /**
     * @description  验证手机号
     * @author yaobing
     * @created Date 2022/08/30 19:30:19
     * @modified By  yaobing
     * @modified Date  2022/08/30 19:30:19
     * @param mobile
     * @return boolean
     */

    public static final boolean isMobile(String mobile){

        if(StringUtils.isBlank(mobile))return false;

        return pattern.matcher(mobile).matches();
    }
}
